package com.cn.boot.spring.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "wx_user_permission_relation", schema = "spring", catalog = "")
public class WxUserPermissionRelationEntity {
    private long id;
    private Long userId;
    private Long permissionId;
    private Byte type;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id")
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "permission_id")
    public Long getPermissionId() {
        return permissionId;
    }

    public void setPermissionId(Long permissionId) {
        this.permissionId = permissionId;
    }

    @Basic
    @Column(name = "type")
    public Byte getType() {
        return type;
    }

    public void setType(Byte type) {
        this.type = type;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        WxUserPermissionRelationEntity that = (WxUserPermissionRelationEntity) o;
        return id == that.id &&
                Objects.equals(userId, that.userId) &&
                Objects.equals(permissionId, that.permissionId) &&
                Objects.equals(type, that.type);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, permissionId, type);
    }
}
